<template>
  <div class="time-box ct">
    <div>订单日期：</div>
    <el-date-picker
      v-model="date"
      type="daterange"
      start-placeholder="开始日期"
      end-placeholder="结束日期"
      :default-time="['00:00:00', '23:59:59']"
    >
    </el-date-picker>
  </div>
</template>

<script>
import { Bus } from "../../Bus";
export default {
  data() {
    return {
      date: "",
      timeobj: {
        stime: "",
        etime: "",
      },
    };
  },
  updated() {
    this.timeobj.stime = this.date[0].getTime();
    this.timeobj.etime = this.date[1].getTime();
    Bus.$emit("timeobj", this.timeobj);
  },
};
</script>

<style lang="less" scoped>
.time-box {
  width: 450px;
  display: flex;
  align-items: center;
}
</style>